﻿using System.ServiceProcess;
using Rio.Workflow.WCF.Configuration;


namespace Rio.WorkflowService
{
    public partial class RioWorkflowService : ServiceBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="RioWorkflowService" /> class.
        /// </summary>
        public RioWorkflowService()
        {
            ServiceName = "RIO Workflow Service";
        }

        /// <summary>
        /// When implemented in a derived class, executes when a Start command is
        /// sent to the service by the Service Control Manager (SCM) or when the operating
        /// system starts (for a service that starts automatically). Specifies actions to
        /// take when the service starts.
        /// </summary>
        /// <param name="args">Data passed by the start command.</param>
        protected override void OnStart(string[] args)
        {
            ServiceManager.StartService();
            if (ServiceManager.Runtime.IsStarted)
            {

            }
        }

        /// <summary>
        /// When implemented in a derived class, executes when a Stop command is
        /// sent to the service by the Service Control Manager (SCM). Specifies actions to
        /// take when a service stops running.
        /// </summary>
        protected override void OnStop()
        {
            ServiceManager.Shutdown();
        }
    }
}